<?
// Form.php
// written by: David Fudge [rkstar@mac.com]
// created on: September 9, 2009  (hey! 9/9/9... spooky)
//
// description:
// this static class will allow us to access any form submission vars through
// a globally available static class making it easier in syntax than $_POST["varname"].
// the syntax for accessing a form var, whether through $_POST, $_GET, or
// php://input (ie. XML submission) will be Form::varname
// easy right?
//
class Form
{
	private $_form;
	private $_loaded = false;

	public function __construct() { $this->init(); }
	private function init()
	{
		if( $_loaded ) { return; }
		global $_REQUEST, $_GET, $_POST;
		$vars = array_merge($_REQUEST, $_GET, $_POST);
		while( list($k,$v) = each($vars) ) { $this->set($k,$v); }
	}
	public function get( $var ) { return (isset($this->_form->$k) && (strlen($this->_form->$k)>0)) ? $this->_form->$var : null; }
	public function set( $key, $value ) { $this->_form->$key = $value; }
}
?>